package com.jltx.xq.relaxnewspro.utils;

import android.content.Context;
import android.content.SharedPreferences;

import com.jltx.xq.relaxnewspro.framework.App;

/**
 * Created by bo on 2017/4/18.
 */

public class Settings {
    public static boolean isAutoRefresh = false;
    public static boolean noPicMode = false;
    private static Settings sInstance;
    private SharedPreferences mPrefs;
    private static final String XML_NAME = "settings";
    public static final String NO_PIC_MODE = "no_pic_mode";

    public static Settings getsInstance(){
        if(sInstance == null){
            sInstance = new Settings(App.getApp().getApplicationContext());
        }
        return sInstance;
    }

    private Settings(Context context){
        mPrefs = context.getSharedPreferences(XML_NAME, Context.MODE_PRIVATE);
    }

    public boolean getBoolean(String key, boolean def){
        return mPrefs.getBoolean(key,def);
    }
}
